<template>
  <ul class="collection_mainlist">
    <li v-for="(item,key) in collectionlist" :key="key" @click="godetails(item.vid,item.data_type)">
      <span class="lesson_mainlist_pic">
        <img :src="item.picture" alt mode="widthFix">
        <p v-if="item.data_type == 2">专栏</p>
        <p v-if="item.data_type == 1">视频</p>
        <p v-if="item.data_type == 3">图文</p>
      </span>
      <span class="collection_mainlist_txt">
        <span class="title">{{item.title}}</span>
        <span class="text">{{item.detail}}</span>
        <span class="info">
          <p>{{item.open}}人开通</p>
          <span class="price">
            <p>&yen;{{item.market_price}}</p>
            <p>
              <del>{{item.shop_price}}</del>
            </p>
          </span>
        </span>
      </span>
    </li>
  </ul>
</template>

<script>
  export default {
    name: "CollectionList",
    props: {
      collectionlist: {}
    },
    data() {
      return {};
    },
    methods: {
      godetails(e, s) {
        if (s == 2) {
          this.$router.push({
            pash: "/detailofboom",
            name: "detailofboom",
            query: { vid: e }
          });
        }
        if (s == 1) {
          this.$router.push({
            pash: "/detailofvedio",
            name: "detailofvedio",
            query: { vid: e }
          });
        }
        if (s == 3) {
          this.$router.push({
            pash: "/detailofpic",
            name: "detailofpic",
            query: { vid: e }
          });
        }
      }
    },
    computed: {
      recommendList() {
        return this.collectionlist;
      }
    }
  };
</script>

<style lang="less" scoped>
  .collection_mainlist li {
    width: 100%;
    height: 7.5rem;
    border-bottom: 1px solid #f5efef;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    background: white;
    .lesson_mainlist_pic {
      position: relative;
      width: 40%;
      height: 5.65rem;
      display: flex;
      justify-content: center;
      margin-top: 1rem;
      margin-left: 1rem;
      p {
        position: absolute;
        bottom: 0;
        width: 100%;
        text-align: right;
        font-size: 14px;
        background: linear-gradient(#908080, black);
        opacity: 0.3;
        color: white;
      }
      img {
        width: 100%;
        border-radius: 0.5rem;
      }
    }
    .collection_mainlist_txt {
      margin-top: 1rem;
      margin-right: 1rem;
      margin-left: 0.7rem;
      width: 60%;
      height: 5.65rem;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      .title {
        width: 100%;
        height: 2.5rem;
        overflow: hidden;
        font-size: 0.93rem;
        line-height: 1.1rem;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
      .text {
        margin-bottom: 15px;
        font-size: 11px;
        line-height: 14px;
        height: 34px;
        color: #acacac;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }
      .info {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        font-size: 13px;
        color: #b8b8b8;
        .price {
          display: flex;
          flex-direction: row;
          align-items: center;
          p:first-child {
            color: #dc376d;
            font-size: 15px;
            font-weight: 600;
            margin-right: 5px;
          }
        }
      }
    }
  }
</style>
